<%= link_to sprintf("Youth %03d", @data_collection.youth.id), :controller => 'youth', :action => 'edit', :id => @data_collection.youth.id %> >
Data collection: <%= @data_collection.data_collection_type.name %>

<h1>Data collection: <%= @data_collection.data_collection_type.name %></h1>
<%= link_to "Delete this data collection", {:action => 'delete', :id => @data_collection.id}, :confirm => "Really delete data collection? All related questionnaires will be lost."  %>
<p></p>

<% form_tag :action => 'update', :id => @data_collection do %>

  <div id="formTable">
    <table>
      <tr>
        <td><b>Target date:</b></td>
        <td><%= date_select('data_collection', 'target_date', :include_blank => false, :start_year => 2009, :order => [:day, :month, :year]) %></td>
      </tr>

      <tr>
        <td><b>Status:</b></td>
        <td><%= @data_collection.calculate_status %></td>
      </tr>
    </table>
  </div>

  <%= submit_tag "Save" %>

<% end %>



<% form_tag :controller => 'questionnaire_event', :action => 'create_multiple', :data_collection_id => @data_collection.id do %>
  <h2>Questionnaires</h2>

  <div id="resultSet">
    <%= render :partial => 'questionnaire/dc_questionnaires_list' %>
  </div>

  <div id="rightAlign">
    <%= link_to 'Create questionnaire', {:controller => 'questionnaire', :action => 'new', :data_collection => @data_collection} %>
  </div>

  <p>
    <%= collection_select(:questionnaire_event, :questionnaire_event_type_id, QuestionnaireEventType.find(:all), :id, :name) %>
    <%= date_select(:questionnaire_event, :event_date, :include_blank => false, :start_year => 2009, :order => [:day, :month, :year]) %>
    <%= text_field('questionnaire_event', 'comment') %>
    <%= submit_tag "Update selection" %>
  </p>

<% end %>
